using UnityEngine;

namespace IQIGame.Onigao.GamePlay
{
    public static class LevelMathUtil
    {
        public const float RectTriggerHeight = 2f;

        public static Vector3 MoveInDirection(Vector3 position, Quaternion rotation, float distance)
        {
            // Create a vector pointing in the direction the object is facing
            Vector3 direction = rotation * Vector3.forward;

            // Scale the direction by the desired distance
            direction *= distance;

            // Add the direction vector to the original position to get the new position
            Vector3 newPosition = position + direction;

            return newPosition;
        }

        public static Vector3 Rect2OBBSize(Game.RectInt rect)
        {
            return GameMathUtil.Rect2OBBSize(rect, RectTriggerHeight);
        }
    }
}
